using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using ZSW.Framework;

namespace Main.Details
{
    [CreateAssetMenu(fileName = "BluePrintDataList_SO", menuName = "Inventory/BluePrintDataList_SO", order = 0)]
    public class BluePrintDataList_SO : ZSWF_SOSingleton<BluePrintDataList_SO>
    {
        public List<BluePrintDetails> DataList;

        public bool TryGetBluePrintDetails(int id, out BluePrintDetails bluePrintDetails)
        {
            bluePrintDetails = null;

            foreach (var item in DataList)
            {
                if (item.ID == id)
                {
                    bluePrintDetails = item;
                    return true;
                }
            }

            return false;
        }
    }

    [Serializable]
    public class BluePrintDetails
    {
        public int ID;
        public InventoryItem[] resourceItem = new InventoryItem[4];
        public GameObject buildPrefab;
    }
}